package com.zhf.cloud.gateway.springcloudgateway.model.user;

import com.zhf.cloud.gateway.springcloudgateway.entity.MerchantModulePermission;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author: 曾鸿发
 * @create: 2021-11-22 11:50
 * @description：
 **/
@Data
public class NewPermission  implements Serializable {

    private static final long serialVersionUID = 3188397416169252219L;

    private Long id;
    private Long roleId;
    private String permissionId;
    private String permissionName;
    private String actions;
    private List<NewActionEntity> actionEntitySet = new ArrayList<>();
    private String actionList;
    private String dataAccess;

    public static NewPermission convertFromMerchantModulePermission(MerchantModulePermission merchantModulePermission) {

        NewPermission newPermission = new NewPermission();

        newPermission.setId(merchantModulePermission.getId());
        //newPermission.setRoleId(roleId);
        newPermission.setPermissionId(merchantModulePermission.getPermissionId());
        newPermission.setPermissionName(merchantModulePermission.getPermissionName());
        newPermission.setPermissionName(merchantModulePermission.getPermissionName());

        return newPermission;
    }
}
